#include<stdio.h>
int main()
{
	int a[1000],min,mid,max,n,i,x,k=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	scanf("%d",&x);
	min=0;
	max=n-1;
	while(min!=max)
	{
		mid=(min+max)/2;
		if(x>a[mid])
		{
			min=mid+1;
			k++;continue;
		}
		if(x<a[mid])
		{
			max=mid-1;
			k++;continue;
		}
		if(x==a[mid])
		{
			k++;
			printf("YES %d\n",k);
			break;
		}
	}
	if(min==max)
	{
		k++;
		printf("NO %d\n",k);
	}
	return 0;
}
